package coms.itboyes.bycommon.myutiltest;

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.RelativeLayout;
import android.widget.TextView;

import coms.itboyes.bycommon.base.BaseActivity;
import coms.itboyes.bycommon.commonwidget.address.AddressFragment;
import coms.itboyes.bycommon.toast.helper.MAlert;

public class MainActivity extends BaseActivity implements AddressFragment.GetInforListener {
    TextView test;
    EditText edit;
    TextView choose;
    RelativeLayout address_jiedao;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_adress_add);
        address_jiedao= (RelativeLayout) findViewById(R.id.address_jiedao);
        address_jiedao.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                AddressFragment addressFragment = new AddressFragment();
                addressFragment.show(getSupportFragmentManager(), "addressfragment");
            }
        });
//        startActivity(new Intent(this, PullableGridViewActivity.class));
//        String url = "http://ww3.sinaimg.cn/large/610dc034jw1f6m4aj83g9j20zk1hcww3.jpg";
//        SimpleDraweeView simpleDraweeView=(SimpleDraweeView)findViewById(sdv_1);
//        edit= (EditText) findViewById(R.id.edit);
//        test= (TextView) findViewById(R.id.test);
//        choose=(TextView) findViewById(R.id.choose);
//        LoadingUtil.showProgressDialog(this,"数据加载中",true);//显示进度框
//        test.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                test.setText(""+ UnitConversionUtil.getDouble(edit.getText().toString()));
//            }
//        });
//        choose.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View view) {
//                CameraPopupWindow cameraPopupWindow=new CameraPopupWindow(MainActivity.this,cameraClick);
//                cameraPopupWindow.showAtLocation(view, Gravity.BOTTOM
//                        | Gravity.CENTER_HORIZONTAL, 0, 0);
//            }
//        });
/*        simpleDraweeView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //测试时间
//                LoadingUtil.closeProgressDialog();

                Intent intent=new Intent(MainActivity.this,TestActivity.class);
                startActivity(intent);
//                MAlert.alert("测试以");//默认上方出现
//                MAlert.alert("测试二", Gravity.BOTTOM);//设置下方出现
//                MAlert.alert("测试三", Gravity.CENTER,R.color.jmui_chat_text_color);//自定义颜色值
            }
        });*/
//        simpleDraweeView.setImageURI(url);
        String url = "http://ww3.sinaimg.cn/large/610dc034jw1f6m4aj83g9j20zk1hcww3.jpg";
        // 从网络加载一张图片
//        Phoenix.with((SimpleDraweeView)findViewById(R.id.sdv_1)).load(url);
//        // 网络加载一张图片，并以圆形显示
//        ImageLoader.loadImage(simpleDraweeView, url);
//
//        //设置宽高比
//        ViewGroup.LayoutParams lvp = simpleDraweeView.getLayoutParams();
//        lvp.width = DensityUtil.getDisplayWidth(this);
//        simpleDraweeView.setAspectRatio(0.6f); // 设置宽高比
//        ImageLoader.loadDrawable(simpleDraweeView, R.mipmap.ic_launcher,
//                DensityUtil.getDisplayWidth(this), DensityUtil.getDisplayHeight(this));
//
//        //设置宽高
//        ViewGroup.LayoutParams vpl = simpleDraweeView.getLayoutParams();
//        vpl.width = DensityUtil.getDisplayWidth(this) - DensityUtil.dipToPixels(this, 22);
//        vpl.height = DensityUtil.getDisplayWidth(this) - DensityUtil.dipToPixels(this, 20);
//        ImageLoader.loadImage(simpleDraweeView, url);
//
//
//        //高斯模糊的实现
//        simpleDraweeView.setAspectRatio(0.7f);
//        lvp.width = DensityUtil.getDisplayWidth(this);
//        ImageLoader.loadImageBlur(simpleDraweeView, url,
//                DensityUtil.getDisplayWidth(this), DensityUtil.getDisplayHeight(this));
//
//        //对任意View的背景，进行高斯模糊效果的实现
//        ImageLoader.loadImageBlur(simpleDraweeView, url);

        //加载Bitmap
//        ImageLoader.loadBitmap(this,simpleDraweeView,url);
//
////        // 网络加载一张图片，并以圆形加边框显示
//        ImageLoader.loadImage(simpleDraweeView, url);
//
//        ImageLoader.loadImage(simpleDraweeView, url);
//
//        ImageLoader.loadImage(simpleDraweeView, url);
//
//        ImageLoader.loadImage(simpleDraweeView, url);
//
//        ImageLoader.loadImage(simpleDraweeView, "");
//
//        ImageLoader.loadImage(simpleDraweeView, url);
//
//        ImageLoader.loadImage(simpleDraweeView, url);
//        simpleDraweeView.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                Log.i("按下效果","");
//
//            }
//        });
//
//        ImageLoader.loadImage(simpleDraweeView, url);
//
//        String url2 = "http://www.baidu.com";
//        ImageLoader.loadImage(simpleDraweeView, url2);

    }

    @Override
    public void onGetinforListener(String province, String city, String district, String provincNo, String cityNo, String districtNo) {
        MAlert.alert(province+":"+city+":"+district);
    }
//    private View.OnClickListener cameraClick=new View.OnClickListener() {
//        @Override
//        public void onClick(View view) {
//
//        }
//    };
}
